package com.qh.book.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.qh.book.dataobj.HomeImgs;
import com.qh.book.enums.ResultEnum;
import com.qh.book.service.HomeImgsService;

@Controller
@RequestMapping("/backstage/ad")
public class AdController {

	@Autowired
	private HomeImgsService homeImgsService;
	

	/**
	 * 获取首页所有轮播图
	 * @param map
	 * @return
	 * @author qihong
	 */
	@GetMapping("/homeimgs")
	public ModelAndView getHomeImgs(Map<String, Object> map) {
		
		List<HomeImgs> homeImgsList = homeImgsService.findAll();
		map.put("homeImgsList", homeImgsList);
		
		return new ModelAndView("ad/homeimgs", map);
	}
}
